package com.crayon.account.fragments;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.crayon.account.dao.DAOAccount;
import com.crayon.account.data.EDAType;
import com.crayon.account.data.ItemList;
import com.crayon.sharemenu.R;
import com.crayon.util.UTILSC;

import java.util.Arrays;
import java.util.List;

public class FragmentListWrite extends FragmentListRoot implements OnItemClickListener{

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
		// TODO Auto-generated method stub
		ListView listView = (ListView)getView().findViewById(R.id.listView);
		ItemList itemList = (ItemList)listView.getAdapter().getItem(position);
		DAOAccount item =new DAOAccount(itemList.getType());
		UTILSC.addOnPopWriteFragment(getActivity(), item, null);
	}

	@Override
	public List<ItemList> getOnLitemList(List<ItemList> itemarray) {
		// TODO Auto-generated method stub
		return Arrays.asList(
				new ItemList(getString(R.string.menu_write_incom),EDAType.INCOM),
				new ItemList(getString(R.string.menu_write_outcom),EDAType.OUTCOM),
				new ItemList(getString(R.string.menu_write_fixedincom),EDAType.FIXEDINCOM),
				new ItemList(getString(R.string.menu_write_fixedoutcom),EDAType.FIXEDOUTCOM)
				);
				
	}

	@Override
	public ItemList getOnNewCreateItem() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isShownNewCreaetButton() {
		// TODO Auto-generated method stub
		return false;
	}


}
